import React, { createContext, FC, useState } from "react";
import ContextCard from "./components/ContextCard";

interface ContextProps {
  value: number;
  handleValue?: (num: number) => void;
}
export const ValueContext = createContext<ContextProps>({ value: 0 });

const Mine: FC = () => {
  const [state, setState] = useState<number>(123);

  const contextValue: ContextProps = {
    value: state,
    handleValue: setState,
  };
  return (
    <ValueContext.Provider value={contextValue}>
      <ContextCard />
    </ValueContext.Provider>
  );
};

export default Mine;
